header.content-header.js-content-header
  h1 = t('fae.application.activity_log_heading')

main.content

  == fae_filter_form title: t('fae.changes.title'), action: fae.activity_log_filter_path do
    == fae_filter_select :type, options: [t('fae.changes.created'), t('fae.changes.updated'), t('fae.changes.deleted')], translation_path: 'fae.changes.models'
    == fae_filter_datepicker :start_date, placeholder: 'MM/DD/YYYY', class: 'test'
    == fae_filter_datepicker :end_date, placeholder: 'MM/DD/YYYY'
    == fae_filter_select :date, options: [t('fae.changes.last_hour'), t('fae.changes.last_day'), t('fae.changes.last_week'), t('fae.changes.last_month')], placeholder: t('fae.changes.all_time')
    br
    == fae_filter_select :user, options: Fae::User.all.map { |u| [u.full_name, u.id] }, translation_path: 'fae.changes.models'
    == fae_filter_select :model, options: Fae::Change.unique_changeable_types, translation_path: 'fae.changes.models'

  table.js-results-table
    thead
      tr
        th data-sort="user.first_name" = t('fae.changes.user')
        th data-sort="changeable_type" = t('fae.changes.item')
        th data-sort="change_type" = t('fae.changes.type')
        th = t('fae.changes.attrs')
        th data-sort="updated_at" = t('fae.changes.modified')
    tbody
      - if @items.present?
        - @items.each do |change|
          tr
            td = change.user.full_name if change.user.present?
            td = change_item_link(change)
            td = change.change_type
            td = change.updated_attributes.join(', ') if change.updated_attributes.present?
            td = fae_datetime_format(change.updated_at)
      - else
        tr
          td colspan=5 = t('fae.changes.no_changes')

  == fae_paginate @items
